import 'package:miaowu/app/common/window_pop/public_btn_tem.dart';
import 'package:miaowu/app/module/mine/money/member_vip/member_config.dart';

class WalletConfigData {
  Sec1? sec1;
  Sec2? sec2;
  Sec41? sec41;
  Sec42? sec42;
  Sec5? sec5;

  WalletConfigData({this.sec1, this.sec2, this.sec41, this.sec42, this.sec5});

  WalletConfigData.fromJson(Map<String, dynamic> json) {
    if (json["sec1"] is Map) {
      sec1 = json["sec1"] == null ? null : Sec1.fromJson(json["sec1"]);
    }
    if (json["sec2"] is Map) {
      sec2 = json["sec2"] == null ? null : Sec2.fromJson(json["sec2"]);
    }
    if (json["sec41"] is Map) {
      sec41 = json["sec41"] == null ? null : Sec41.fromJson(json["sec41"]);
    }
    if (json["sec42"] is Map) {
      sec42 = json["sec42"] == null ? null : Sec42.fromJson(json["sec42"]);
    }
    if (json["sec5"] is Map) {
      sec5 = json["sec5"] == null ? null : Sec5.fromJson(json["sec5"]);
    }
  }

  static List<WalletConfigData> fromList(List<Map<String, dynamic>> list) {
    return list.map(WalletConfigData.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    if (sec1 != null) {
      json["sec1"] = sec1?.toJson();
    }
    if (sec2 != null) {
      json["sec2"] = sec2?.toJson();
    }
    if (sec41 != null) {
      json["sec41"] = sec41?.toJson();
    }
    if (sec42 != null) {
      json["sec42"] = sec42?.toJson();
    }
    if (sec5 != null) {
      json["sec5"] = sec5?.toJson();
    }
    return json;
  }

  WalletConfigData copyWith({
    Sec1? sec1,
    Sec2? sec2,
    Sec41? sec41,
    Sec42? sec42,
    Sec5? sec5,
  }) =>
      WalletConfigData(
        sec1: sec1 ?? this.sec1,
        sec2: sec2 ?? this.sec2,
        sec41: sec41 ?? this.sec41,
        sec42: sec42 ?? this.sec42,
        sec5: sec5 ?? this.sec5,
      );
}

class Sec42 {
  int? view;
  String? title;

  Sec42({this.view, this.title});

  Sec42.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["title"] is String) {
      title = json["title"];
    }
  }

  static List<Sec42> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec42.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    json["title"] = title;
    return json;
  }

  Sec42 copyWith({
    int? view,
    String? title,
  }) =>
      Sec42(
        view: view ?? this.view,
        title: title ?? this.title,
      );
}

class Click1 {
  String? react;
  String? option;

  Click1({this.react, this.option});

  Click1.fromJson(Map<String, dynamic> json) {
    if (json["react"] is String) {
      react = json["react"];
    }
    if (json["option"] is String) {
      option = json["option"];
    }
  }

  static List<Click1> fromList(List<Map<String, dynamic>> list) {
    return list.map(Click1.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["react"] = react;
    json["option"] = option;
    return json;
  }

  Click1 copyWith({
    String? react,
    String? option,
  }) =>
      Click1(
        react: react ?? this.react,
        option: option ?? this.option,
      );
}

class Sec2 {
  int? view;
  List<CoinOptions>? coinOptions;

  Sec2({this.view, this.coinOptions});

  Sec2.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["coinOptions"] is List) {
      coinOptions = json["coinOptions"] == null
          ? null
          : (json["coinOptions"] as List).map((e) => CoinOptions.fromJson(e)).toList();
    }
  }

  static List<Sec2> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec2.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    if (coinOptions != null) {
      json["coinOptions"] = coinOptions?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec2 copyWith({
    int? view,
    List<CoinOptions>? coinOptions,
  }) =>
      Sec2(
        view: view ?? this.view,
        coinOptions: coinOptions ?? this.coinOptions,
      );
}

class CoinOptions {
  int? rechid;
  String? rechName;
  String? priceStr;
  int? rechCoin;
  String? rechExtra;
  String? iosId;
  int? price;

  CoinOptions({this.rechid, this.rechName, this.priceStr, this.rechCoin, this.rechExtra, this.iosId, this.price});

  CoinOptions.fromJson(Map<String, dynamic> json) {
    if (json["rechid"] is num) {
      rechid = (json["rechid"] as num).toInt();
    }
    if (json["rech_name"] is String) {
      rechName = json["rech_name"];
    }
    if (json["priceStr"] is String) {
      priceStr = json["priceStr"];
    }
    if (json["rech_coin"] is num) {
      rechCoin = (json["rech_coin"] as num).toInt();
    }
    if (json["rech_extra"] is String) {
      rechExtra = json["rech_extra"];
    }
    if (json["ios_id"] is String) {
      iosId = json["ios_id"];
    }
    if (json["price"] is num) {
      price = (json["price"] as num).toInt();
    }
  }

  static List<CoinOptions> fromList(List<Map<String, dynamic>> list) {
    return list.map(CoinOptions.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["rechid"] = rechid;
    json["rech_name"] = rechName;
    json["priceStr"] = priceStr;
    json["rech_coin"] = rechCoin;
    json["rech_extra"] = rechExtra;
    json["ios_id"] = iosId;
    json["price"] = price;
    return json;
  }

  CoinOptions copyWith({
    int? rechid,
    String? rechName,
    String? priceStr,
    int? rechCoin,
    String? rechExtra,
    String? iosId,
    int? price,
  }) =>
      CoinOptions(
        rechid: rechid ?? this.rechid,
        rechName: rechName ?? this.rechName,
        priceStr: priceStr ?? this.priceStr,
        rechCoin: rechCoin ?? this.rechCoin,
        rechExtra: rechExtra ?? this.rechExtra,
        iosId: iosId ?? this.iosId,
        price: price ?? this.price,
      );
}

class Sec1 {
  int? view;
  String? coin;
  String? title;
  List<PublicBtnItem>? btns;

  Sec1({this.view, this.coin, this.title, this.btns});

  Sec1.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["coin"] is String) {
      coin = json["coin"];
    }
    if (json["title"] is String) {
      title = json["title"];
    }
    if (json["btns"] is List) {
      btns = json["btns"] == null ? null : (json["btns"] as List).map((e) => PublicBtnItem.fromJson(e)).toList();
    }
  }

  static List<Sec1> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec1.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    json["coin"] = coin;
    json["title"] = title;
    if (btns != null) {
      json["btns"] = btns?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec1 copyWith({
    int? view,
    String? coin,
    String? title,
    List<PublicBtnItem>? btns,
  }) =>
      Sec1(
        view: view ?? this.view,
        coin: coin ?? this.coin,
        title: title ?? this.title,
        btns: btns ?? this.btns,
      );
}
